﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PagedList<CourseSystem.Core.Entities.CommonResourcesInfo>>" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
    <%
        var count = Model.Count;
        for (int i = 0; i < Model.Count; i++)
        {
            var startI = i;
    %>
    <tr class="style1">
        <td width="270" height="25">
            <div align="right">
                <img src="<%=ResolveUrl("~/"+Model[i++].FileName) %>" width="223" height="170" alt="" /></div>
        </td>
        <td width="270">
            <div align="right">
                <% if (i < count)
                   {%>
                <img src="<%=ResolveUrl("~/"+Model[i++].FileName) %>" width="223" height="170" alt="" /><% } %></div>
        </td>
        <td width="270">
            <% if (i < count)
               {%>
            <img src="<%=ResolveUrl("~/"+Model[i].FileName) %>" width="223" height="170" alt="" /><% } %></div>
        </td>
    </tr>
    <tr class="style1">
        <td height="25">
            <div align="center">
                作者：<%=Model[startI].Author %>&nbsp;&nbsp;&nbsp;&nbsp;
                <%=Html.ActionLink("浏览", "View", new { Model[startI].Id }, new { @class = "style26" })%>&nbsp;&nbsp;&nbsp;
                <a href="<%=ResolveUrl("~/" + Model[startI++].FileName)%>" class="style26" target="_blank">
                    下载</a></div>
        </td>
        <td>
            <div align="center">
                <% if (startI < count)
                   {%>
                作者：<%=Model[startI].Author%>&nbsp;&nbsp;&nbsp;&nbsp;
                <%=Html.ActionLink("浏览", "View", new {Model[startI].Id}, new {@class = "style26"})%>&nbsp;&nbsp;&nbsp;
                <a href="<%=ResolveUrl("~/" + Model[startI++].FileName)%>" class="style26" target="_blank">
                    下载</a><% } %></div>
        </td>
        <td>
            <div align="center">
                <% if (startI < count)
                   {%>
                作者：<%=Model[startI].Author%>&nbsp;&nbsp;&nbsp;&nbsp;
                <%=Html.ActionLink("浏览", "View", new {Model[startI].Id}, new {@class = "style26"})%>&nbsp;&nbsp;&nbsp;
                <a href="<%=ResolveUrl("~/" + Model[startI].FileName)%>" class="style26" target="_blank">
                    下载</a><% } %></div>
        </td>
    </tr>
    <%} %>
</table>
<table width="98%" height="7" border="0" align="center" cellpadding="0" cellspacing="0"
    bordercolor="#FFFFFF">
    <tr>
        <td class="gray12">
            &nbsp;
        </td>
        <td align="right" class="gray12">
            <%=Html.AjaxPager(Model, new PagerOptions() { ContainerTagName = "span", CssClass = "mvcPager", PageIndexParameterName = "pid", ShowMorePagerItems = false, AlwaysShowFirstLastPageNumber = true, }, new AjaxOptions() { UpdateTargetId = "listDiv" })%>
            共<%=Model.TotalItemCount %>条记录，页<%=Model.CurrentPageIndex %>/<%=Model.TotalPageCount %>
        </td>
    </tr>
</table>
